
{% extends 'base_main_goods.html' %}
{% block title %}
    天天生鲜-首页
{% endblock %}

{% block content %}
	<div class="center_con clearfix">
		<ul class="subnav fl">
			<li><a href="#model01" class="fruit">新鲜水果</a></li>
{#            这是锚点，定位的   #}
			<li><a href="#model02" class="seafood">海鲜水产</a></li>
			<li><a href="#model03" class="meet">猪牛羊肉</a></li>
			<li><a href="#model04" class="egg">禽类蛋品</a></li>
			<li><a href="#model05" class="vegetables">新鲜蔬菜</a></li>
			<li><a href="#model06" class="ice">速冻食品</a></li>
		</ul>
		<div class="slide fl">
			<ul class="slide_pics">
                {% load static %}
				<li><img src='{% static "images/slide.jpg" %}' alt="幻灯片"></li>
				<li><img src='{% static "images/slide02.jpg" %}'  alt="幻灯片"></li>
				<li><img src='{% static "images/slide03.jpg" %}'  alt="幻灯片"></li>
				<li><img src='{% static "images/slide04.jpg" %}'  alt="幻灯片"></li>
			</ul>
			<div class="prev"></div>
			<div class="next"></div>
			<ul class="points"></ul>
		</div>
		<div class="adv fl">
			<a href="#"><img src='{% static "images/adv01.jpg" %}'></a>
			<a href="#"><img src='{% static "images/adv02.jpg" %}'></a>
		</div>
	</div>

    {% for key,value in goods_dict.items %}
        <div class="list_model">
            <div class="list_title clearfix">
                <h3 class="fl" id="model0{{ forloop.counter }}" >{{ key }}</h3>
                <a href="#" class="goods_more fr" id="fruit_more">查看更多 ></a>
            </div>
            <label>
                <div class="goods_con clearfix">
                    <div class="goods_banner fl"><img src='/media/{{ value.0.category.category_front_image }}'></div>
                    <ul class="goods_list fl">
                        {% for goods in value %}
                        <li>
                            <h4>{{ goods.name }}</h4>
                            <a href="{% url 'goods:detail' goods.id %}"><img src='/media/{{ goods.goods_front_image }}'></a>
                            <div class="prize">{{ goods.shop_price }}</div>
                        </li>
                            {% endfor %}
                    </ul>
                </div>
            </label>
        </div>
    {% endfor %}

    {% load static %}
    <script type="text/javascript" src='{% static "js/slideshow.js" %}'></script>
	<script type="text/javascript">
		BCSlideshow('focuspic');
		var oFruit = document.getElementById('fruit_more');
		var oShownum = document.getElementById('show_count');

		var hasorder = localStorage.getItem('order_finish');

		if(hasorder)
		{
			oShownum.innerHTML = '2';
		}

		oFruit.onclick = function(){
			window.location.href = 'list.html';
		}
	</script>

{% endblock %}

{% block subnav_fl %}

{% endblock %}

{% block navbar %}

<div class="navbar">
			<h1 class="fl">
{% endblock %}